<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery.js"></script>
    <style>
        h1 {
            font-weight: bold;
            font-size: 28px;
        }

        th {
            font-weight: bold;
            background-color: gray;
        }

        tr:nth-child(odd) {
            background-color: gray;

        }

        a {
            text-decoration: none;
        }

        .box1 {
            margin: 0 auto;
            text-align: center;
            width: 800px;
            height: 600px;
        }
        .box1 .addConcert{
            margin-left: -720px;
        }
    </style>
</head>
<body>

<div class="box1">
    <h1>演唱会信息列表</h1>
    <input class="addConcert" type="button" value="添加演唱会" onclick="location.href = 'add.jsp'">
    <table border="1">
        <tr>
            <th>编号</th>
            <th>演唱会名称</th>
            <th>价格</th>
            <th>是否推荐</th>
            <th>城市</th>
            <th>详细地址</th>
            <th>开始时间</th>
        </tr>
        <c:forEach var="concert" items="${list}">
            <tr>
                <td>${concert.concertId}</td>
                <td>${concert.concertName}</td>
                <td>${concert.price}</td>
                <td>${concert.recommend==1?"推荐":"不推荐"}</td>
                <td>${concert.city}</td>
                <td>${concert.address}</td>
                <td>${concert.startTime}</td>
            </tr>
        </c:forEach>
    </table>

    <p>
        <a href="${pageContext.request.contextPath}/page?currentPage=1&pageSize=3">首页</a>
        <a href="${pageContext.request.contextPath}/page?currentPage=${currentPage - 1}&pageSize=3">上一页</a>
        <a href="${pageContext.request.contextPath}/page?currentPage=${currentPage + 1}&pageSize=3">下一页</a>
        <a href="${pageContext.request.contextPath}/page?currentPage=${totalPages}&pageSize=3">尾页</a>
        第${currentPage}页，共${totalPages}页，总记录数${count}条
    </p>
</div>
</body>
</html>
